I want to create a Login Item on Mac. [Documentation](http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLoginItems.html#//apple_ref/doc/uid/10000172i-SW5-BAJJBJEG) provided by apple is really not helping. 

I want a process to run in background as soon as user logs in and it should not be managed by LaunchD.

Can someone help we with details on how to create a login item? I have never done this before, so I am looking for step by step instructions with some sample code. I am targeting 10.6 & 10.7 OS X versions.

Any help highly appreciated.