All COM interfaces are ultimately derived from IUnknown and contain the QueryInterface, AddRef and Release methods.
Following snippet will declare and define a GUID in unmanaged C++ -
#define INITGUID
#include <guiddef.h>
//698291FE-27CF-4EDE-A68D-2CEFA7DF30C5
DEFINE_GUID(MyGuid, 0x698291FE, 0x27CF, 0x4EDE, 0xA6, 0x8D, 0x2C, 0xEF, 0XA7, 0xDF, 0x30, 0xC5);
In my opinion the fastest way to create an in-process COM Server (DLL) is to use ATL. The ATL wizards will handle the IDL file for you but you may need to manually specify any required GUIDs instead of the ones that are generated by the wizards. ATL handles all of the scaffolding code that is required by COM.
Coding a COM Server manually can be time consuming and error prone if you have never done it before.