Assuming that a given USB drive is compromised(infected), what's the best way to deal with it? I mean, obviously, the solution is to nuke(format) the drive. But for that, the device needs to be connected to a PC. Isn't it possible for the malware to spread from the drive to the PC? Sure, antivirus programs might help but they aren't perfect. A particularly nasty piece of malware can utilize that time windows to infect the host PC. What's the foolproof way to deal with such an situation?
As USB drives can be compromised in ways that are not identifiable by an antivirus and not corrected by formatting the drive, the only foolproof solution is to destroy the drive.
Honestly, you don't want to stick an infected USB stick into a Windows OS or Mac OS running system, since merely plugging in can cause infection. Instead, if you suspect your drive is infected, grab a Live CD for a specialized Linux distro that has anti-virus capabilities, such as Avira Rescue System, boot your system into that secure environment, and then scan the USB drive that way. You can also safely copy data off the infected USB stick (but be careful for infected applications you might copy). This is assuming you want to rescue your data. The code can't harm your system if it can run in the OS that's provided (e.g. Windows viruses can't run in Linux, as there are binary differences). Otherwise, if you don't care about the data, simply physically destroy the drive and get a new one.