Interpretation of EN 61000-4-5 Surge requirement on a DC Power Port
The surge test according to IEC EN 61000-4-5 is performed on equipment whose power supply connections are geometrically far away from the device itself, in order to test its resistance to the three following stroke related events (accordig to this nice survey):


Direct lightning strokes to outdoor circuits injecting high currents and producing overvoltages.
Indirect lightning strikes, i.e. strikes between or within clouds or to nearby objects which produce electromagnetic fields that induce voltages/currents on the conductors outside and/or inside a building.
Lightning ground current flows, resulting from nearby direct-to-earth discharges 
coupling into the common ground paths of the grounding system of the installation.


Note that all three events above involve long cable lengths and distances: specifically the third one, which is closely related to the necessity of making a 500V surge test, requires the presence of a long ground path in order to induce a dangerous EMF on nearby cables by high value pulsed currents flowing through it (by the Faraday-Neumann-Lentz law).

Said that, if you equipment is powered from a DC power supply placed within a few meters (precisely within \$3\$ meters of cable, but I can possibly remember a wrong value) from it, the three events above are considered as very low probability events to happen on the DC power input: the DC port is thus considered as a signal port. Therefore you can avoid the IEC EN 61000-4-5 test on the DC input of your equipment, but 


you must do it on the input of your DC power supply (or choose a a power supply tested accordingly) and ship it to be used with your equipment or
state a maximum cable length for the DC supply power cables (customarily less than the maximum one allowed).
Edit: something that I remembered later is that if your device is designed to be embedded inside a larger equipment, you can require your customer to provide you a nice power supply rail, fully protected from surges. Such devices are sometimes called OEM (Original Equipment Manufacturing) devices.


If you choose to not proceed according to the above guidelines, it is implicitly assumed that your equipment can be powered by a DC rail, involving a single power supply placed several (cable) meters away from the DC input of your equipment and which possibly powers other plant equipment as well: then you have to be sure that it survives a surge event, so you have to do the test.