You can create and use COM components with the sp_O stored procedures.

sp_OACreate "MyComponent.Class"

would be used to create an instance of your component - you can then use the other stored procedures to fire methods, set properties, etc.