The license file must be located on the USB flash drive. There is no modification in the source code necessary to use the USB flash drive protection.
In the prepareAndActivate or prepareInit command you specify the path and license file name.
A good idea is to ask during installation, if the application should use a USB flash drive and then open a file dialog to browse for the drive. Save the path in a configuration file.
If the complete application runs on the stick, the path would be the same path where the application starts.
To prevent, that the USB flash drive is removed after the program start, make a regular license test with validate, e.g. every 15 minutes.