This is not a C issue; it's a windows OS issue (I assume). I'm not sure offhand if the autorun technique works for USB sticks (never had to try) but it does work for CDs and DVDs.
The basic format of the autorun.inf file is a straight text file something like;
PHP Code:
[autorun]
open=yourprog.exe
icon=yourprog.ico
There are a few more advanced options as well, but that's the basics.
Keep in mind, however, that windows can be configured by the user so it does not attempt to autorun a new volume, so it pays to provide alternatives (eg obviously named installation program that the user can run). Personally, I always disable autorun.