If, when connected, it's in the Device Manager under the "Smart cards" category, then you'd use RegisterDeviceNotification with DBT_DEVTYP_DEVICEINTERFACE and DEVICE_NOTIFY_ALL_INTERFACE_CLASSES, then WM_DEVICECHANGE to detect DBT_DEVICEARRIVAL/DBT_DEVICEREMOVECOMPLETE and be looking for a device with the class guid {990A2BD7-E738-46C7-B26F-1CF8FB9F1391}