Is there a file on your flash drive named autorun.inf? If you don't see it immediately, set Explorer to show hidden and system files. If you see one, delete it.
What happened was that a worm tried to infect your computer through your flash drive. The exe Windows was trying to start would've spread the worm throughout your system.
Well done. Never thought of a virus. Working like new.