This is actually covered in the API Samples (App/"Launcher Shortcuts"). Have a look at this page for more info. Also check out the ApiDemos manifest, which provides a pretty good explanation (look for the LauncherShortcuts part).
Basically, your provide an intent filter in your manifest containing
<action android:name="android.intent.action.CREATE_SHORTCUT" />
In the activity you defined as the receiver, you check if the calling intent is a ACTION_CREATE_SHORTCUT intent, and if so create a returning intent with some extras (check out the setupShortcut function in the link I provided).
You could also check out the source code for Connectbot which does this pretty well. Hope that helps.