XDA Developers wrote a nifty little application that will prevent you from loosing your (device's) stylus. NoStylusWarning is free and uses HTC Touch HD's sensors to report information.
There's no installation necessary, just download the zip and extract all files in the same location on your device. NoStylusWarning will display a notification if it senses that the stylus is not in place. When suspended, the device will vibrate on that event, when the device is moving — information from G-Sensor, or it is dark outside — information from Light Sensor.
You need to have .NET Compact Framework 3.5 installed on your device in order to run this application.