The pilot reported that smoke was entering the cockpit and that it was accompanied by a burning smell. Subsequently most of the electrical system failed. The aircraft was diverted to Bundaberg and landed without further incident. Examination of the aircraft by maintenance engineers found that the electrical system had been subjected to a high voltage situation and significant damage had been caused to the avionics. The DME (Distance Measuring Equipment) was found to have been the source of the smoke and probably the burning smell. The aircraft is equipped with a high voltage warning light and the engineers found that it illuminated as soon as power was applied to the electrical system. The pilot reported that the light did not illuminate in flight.