If a thread gets in a tight loop and starves the RNDIS session, you will lose your activesync connection. VS2005 may very well lock up in this case.
Things you could try:
- Does your app run okay when it's not on the debugger?
- Can you debug application on the emulator?
- Can you debug a trivial app on your device? (just a main function and a printf, for example)
- Re-install VS2005 and your SDK
- Upgrade to VS2008