It seems that the classical serial number technique could be a solution here.
The technique is similar to what is used by Microsoft to activate a copy of Windows:
During installation, the user is presented with a serial number prompt.
If there is an internet connection, the setup application confirms the serial number by querying the licensing server.
If no internet connection is available, the setup halts, shows a series of numbers and an offline unlock code prompt, and asks the user to call a phone number to get the offline unlock code from the series of numbers.
Depending on the serial number, the setup will be able to install either a standard version or a premium version of the app.
Make sure you understand that it will be possible to bypass any solution you'll implement. Companies such as Microsoft or Adobe wasted millions of dollars on anti-piracy measures; their products are still installed illegally all over the world.
It's up to you to decide how much money you are ready to spend on licensing. For many products, the best ROI would be achieved by a simple sentence explaining that if the companies are found installing illegal copies of software and/or having more users than allowed, they will be sued, and that, even if you don't have the means to detect the illegal behavior and/or are unable to sue your clients.