... Go to Settings > System and check the box beside USB Power Supply. If you don't it won't charge through USB ports.

One end of the USB is a standard USB which can plug into a computer, PS3, or the charger. The other end of the cable is a PS Vita specific plug I believe. I've never seen it anywhere else. You absolutely must have the PS logo facing to the front of the Vita for it to work.

To charge via...
Power Charger: Hook the USB end into the charger and the cord into the wall. It charges at all times no matter what you are doing.

PS3: Hook the USB end into the PS3's USB port. This automatically pulls up the content management screen on the PS3, and while that screen is up the Vita will charge. Your Vita can be turned on or off, and you can do anything on the Vita itself as long as the PS3 has that screen up.

PC: Hook the USB end into the PC's USB port, and power off the Vita. It won't charge if the Vita is on.