Let's suppose I plugged in my UBS flash drive in my friends' PC and it got infected with malware. Is there a way I can wipe the USB drive without connecting it my or some other computer (and infecting it in the process)?
You can plug your USB drive on a virtual machine based on Linux. Before that, you can stop the automatic mount of externals drives.
After, you verify the recognition of your drive with:
You note his path:
/dev/sdX, don't mistake with another drive !!!
You note his blocks count and their sizes (512 by default)
You can erase all datas on the drive with:
dd if=/dev/zero of=/dev/sdX count=<blocks count> bs=<blocks size>
After that, your drive will be totally erased. If you are paranoid, you can delete you virtual machine too. This method doesn't clean the potential infected firmware of your drive.
If it was just an autorun, connect it to a non-windows computer and take a look at the files. There should be an "autorun.inf" file that references some other file(s). Delete them and everything (should) be okay. Or delete everything you don't know just to be sure.
Be aware that it is not a panacea. If the infection put a payload inside your executable, PDF or office document (or some other type of) files, you will not know it until you pass them through a scan.