How to safely find out what's on a mysterious USB device

That flash drive might've been free, but if it's got malware, it's going to cost you.