__uuid
is a convenience to obtain an GUID for a COM class, but any other method will work too. Other than that, your code should work.
The error message looks like a MinGW link error (not enough info in question to be sure), suggesting that you missed a MinGW COM library.