I don't understand, what you mean by this sentense; "output between 5 V and 400 mA"?
Not worded perfectly, I'll give you that, but still very clear what he wants to achieve:
a 5V DC power supply capable of delivering 400mA.
If you want to engineer your own switching power supply (I can see why someone would want to do that, as opposed to hacking a crappy wall-wart), I suggest you look into off-line SMPS chips (look at he product catalogs of manufacturers like Power Integratons, ON Semiconductor, NXP, ST Microelectronics and Texas Instruments). Look at the datasheets, they will give you all the information you need to design a good circuit.