The massive star distribution in the Galaxy and the Magellanic Clouds