It's pretty straight forward:
#include "stdafx.h"
#include "tchar.h"
#import "..\ManagedDLL\bin\Debug\ManagedDLL.tlb" raw_interfaces_only
using namespace ManagedDLL;
ICalculatorPtr pICalc = NULL;
int _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr = CoInitialize(NULL);
pICalc = ICalculatorPtr(__uuidof(ManagedClass));
long lResult = 0;
pICalc->Add(5, 10, &lResult);
wprintf(L"The result is %d\n", lResult);
CoUninitialize();
return 0;
}
(BTW, I suppose this is just a sample, because your managed DLL needs some attributes on the interfaces, classes and methods and must be ComVisible.)