If you don't want to give somebody the implementation of your classes, then there is obviously no way for that person to run your program on their own computer in any way.
You can implement your program as a web service - it will be running on your own server, and the client will have to call it remotely.
You can try to
obfuscate your code (make it hard to decompile), but this not safe in principle (a hacker who tries hard enough can always find it out, no matter how much you encrypt or obfuscate the code). Running it on a server, not giving third parties access to the code, is the only way to make it really safe.