In practice, if they pay for the application's custom development and it's not worth millions, just deliver the program to them with unrestricted rights and let them worry about how they license it to their end users. They paid for the development and should be allowed to use the program however they wish. You do want to limit your own liability for damages that may be caused through the program to the greatest extent allowed by law in your local jurisdiction.
If you think you have contributed valuable intellectual property to the program (as in worth a lot of money) and you wish to protect that intellectual property so that you can make money from it in the future, then you will need a lawyer to help you figure out how best to do that.
If you want to reuse some of the code (i.e. library code) in future projects, just spell out that the source code belongs to you and you can use it for any non-competing purpose in the future. That can be done in plain English. You should still grant them a non-exclusive, worldwide, royalty-free license to use the source code in the future (i.e. if you are not able to maintain the program at some point in the future, they should have the source code and be able to use it to maintain the program).