IUknown is unimplemented. You need to provide all the implementation of IUnknown. Thus, to QI IUknown, you return the this pointer.
AddRef, Release and QI are all implemented by you and not on the parent interface anyway so you have no issues just CALLING addref, no casting is required.