A call to IClassFactory::CreateInstance, or CoCreateInstance for that matter, might possibly fail with the error code CLASS_E_NOTLICENSED, telling the client that the component is not globally licensed on the machine. If this happens, you must resort to obtaining an IClassFactory2 pointer from CoGetClassObject, followed by IClassFactory2::CreateInstanceLic. This assumes, of course, that the client has a license key—if not, it's completely locked out of that component.
Licensing is primarily the concern of application-building tools that can incorporate components into such an application. At design time, the development tool itself is really playing the client role of creating and manipulating objects. When this tool gets to the point of writing or compiling the final application, it must obtain the necessary license for every component it can so that the application can later run on nonlicensed machines.
This process means that the tool first calls IClassFactory2::GetLicInfo for each component and checks fRuntimeKeyAvail in each LICINFO structure returned. If this flag is TRUE, the tool can then call IClassFactory2::RequestLicKey to obtain a key that it saves persistently in the created application. By "saves persistently," I mean that the license key is stored in the application image so that the application, when run itself, will pass the license key in calls to IClassFactory2::CreateInstanceLic.
Some components will not offer a run-time license at all, in which case the generated application has to handle the absence of any of its desired components more robustly. Presumably this means warning the end user that a certain component is missing or not available, and it is beneficial to those end users to distinguish the complete nonexistence of a component from the lack of a proper license. If the component isn't there, CoGetClassObject will fail outright. If there is no license, CoGetClassObject will work but IClassFactory::CreateInstance will fail with CLASS_E_NOTLICENSED. If you want to check ahead of time whether CreateInstance will fail, call IClassFactory2::GetLicInfo first and check the fLicVerified field in LICINFO. If the field is FALSE, you know that the component is not globally licensed and CreateInstance will fail. In either case, you can give the end user a meaningful error message, all the better for your customer support staff.