This is closely related to debugging COM server using CDB/WinDbg combination.
Debugging startup or registration of out of process COM server can be tricky as the process is being started by the COM infrastructure (RpcSs). To debug a COM server called myserver.exe, do run the following:
c:\> reg.exe ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\myserver.exe" /v debugger /t REG_SZ /d "vsjitdebugger.exe" /f
The next time myserver.exe is activated the Visual Studio debugger will popup and provide an option to run a new instance or attach to an existing session.
Note that same technique applies to Windows service.
Comments