I have done this using a free Active-X component available called "ActiveX System Tray Icon" available from from:
http://www.tripsoftware.com/greatbeard/download.htm
You can show and hide an icon in the systray and setup events that fire when you click or double-click on the icon. I use the component in combination with the LVWUTIL VIs to show and hide my VI panel when double-clicking on the sys-tray icon.
Sorry I can't send you any sample code. Its copyrighted material. Good luck!
http://www.medicollector.com