PS: I do know that hub gears have their spindle fixed with the dropouts. I am guessing that the structure the spindle is connected with inside the hub, keeps the planetary gears in place, and the sprocket itself is driving a tubular part which, inside the hub, drives a sun gear.
This, however, still doesn't explain how the shell of the hub rotates in the same direction as the sun gear.