Just because I was asked - shouldn't take this as a guide; modifying nice hubs is structurally better, buying a hub that already does the job is more sane, and if wanting to do this right, fire up kicad/eagle/something and at least design a nice board
( click for big )Regular USB A male connector with cable (from a cable I wasn't using - I'm drowning in the things), chopped off and stripped at one end, coming in from the left.
USB A female connector from an old, dead, power bank on the right. If just connecting these two together, you'd just solder these from
left to right straight through.
For injecting power, solder the black (gnd), green (D+) and white (D-) wires through, and leave the red unconnected. You can pretty much just chop it off entirely but that's a bit of a waste. Now take your PSU, connect the PSU's 0V / 'ground' (not the chassis ground) to the black wire, and the PSU's +5V to where the red wire would have gone. Done. Ideally you'd check for potential differences between the two grounds instead of just blindly wiring them together, but you'd need some screwy PSU/computer for that to be terrible.
There's a few extra things on that board - quick overview of that:
Instead of dropping the USB cable's red wire entirely, I soldered it to a male header that connects to the PSU +5V at the other end. That way I can always use it without the PSU for lower power solutions. If you'd be inclined to do this as well, don't bridge that jumper while also feeding with the PSU. If you do, you may have a bad time.
The PSU's +5V supply is not connected straight through - there's two test points I can stick a multimeter between to get current readings, and if for any reason I don't want to measure current, the track can again be bridged with a jumper for lower power solutions.
At the top left is a resistor that goes to a small LED to indicate power, and on the flip side of the board is an array of capacitors to help deal with initial current draw on the board's end. Ideally these would all be close around the USB socket, but it'll do for something cobbled together. Their leads (bent over the pads) and all the pads underneath got a good globbing of solder on there to carry the current.