powering a USB powered device

That worked perfectly.

Just so I'll understand what I'm doing in the future, is it the fact that I was sourcing current with the transistor instead of sinking?

And what role does that 1k resistor play in my mistake?

Thanks!