You might start with WMI to find the name of the .dll or .exe you want from the component Id, using System.Management, I made a managed class wrapper around Win32_ClassicCOMClassSetting and did this:
ROOT.CIMV2.ClassicCOMClassSetting.ClassicCOMClassSettingCollection comClasses = ROOT.CIMV2.ClassicCOMClassSetting.GetInstances("ComponentId
foreach (ROOT.CIMV2.ClassicCOMClassSetting comClass
Console.WriteLine("AppId= " + comClass.AppID +
"\nComponentId= " + comClass.ComponentId +
"\nInProcServer= " + comClass.InprocServer +
"\nInProcServer32=" + comClass.InprocServer32 +
"\nLocalServer=" + comClass.LocalServer +
"\nLocalServer32=" + comClass.LocalServer32);
Which gives me:
Which then can be used to find the process id and kill it.
To create the managed class wrapper, if you haven't before, you just navigate in the Server Explorer in Visual Studio, to Servers/Management Classes, right-click, Properties, Add Classes, look under Root/CIMV2 and find and add ClassicCOMClassSetting, then when
it's added, right-click on Classic COM Class Settings and select Generate Managed Class, which creates the wrapper for you.
Warning: Expanding the Classic COM Class Settings node will take all day to enumerate all the components; it's best to avoid it, and go through DCOM Application Settings or something else that has Classic COM Class Settings as a child for whatever DCOM apps
derive from it.
One more thing ... note that you may have to drill down through multiple components to find the server hosting your component.