Start the container application (for instance Visual Basic).
Open Visual Studio, Load your project (ActiveX, COM or any other DLL project you want to debug).
Place the necessay breakpoints in your project. You can also place DebugBreak API or 'ASSERT(FALSE)' macro to the place from where you want debugging.
Launch 'Attach to Process' dialog box through 'Build ->Start Debug -> Attach to Process' menu option.
Here select the container application you started, in which you want to test your object. (VB6.EXE, as per example case I mentioned).
Now in container application, place the ActiveX control or create the instance of COM object, if it is not ActiveX control.
Test the control by running application. (The form application, if VB used).
Now the container application (VB6.EXE) is being debugged by VS6 (including other binary loads, DLLs, OCXs...).