I want only answer to additional Tony's questions.
If you want create a COM which can be accessible from VBScript/JScript or from old "classic" ASP you have to implement IDispatch.
In Visual Basic 6 or in VBA of MS Office one can use both ways. If you add Reference to your COM, then you will be use "early bound" (IUnknown or VTable). If you use your COM in VB6 or VBA with CreateObject ("ProgIdName"), that you will be use "late bound".
It is very important to understand, that to make COM accessible from VB6/VBA ect. it's not enough just implement IUnknown interface. You have to create and register Type Library with oleautomation
attribute. To be able to do so, you can use in the interface of your COM only oleautomation
compatible data types (see http://msdn.microsoft.com/en-us/library/aa367129%28VS.85%29.aspx). For understanding the type library play a role of client marshaling DLL, so it helps a client software like VB6/VBA to send correctly data as a parameters to your COM. You should don't forget, that even your COM will be an InProc server, a DLL, parameters will be not forwards directly to COM, but need be marshaled. During marshaling a copy of data will be created on the thread where run your COM. It makes your COM DLL thread safe from one side and you COM will be not crash if the thread calling your COM method will be ended before COM returns the value.
Probably my explanation about marshaling is not easy, but it's just important don't forget to create and register the Type Library which is better to save as a resource inside of COM.