You can protect classes in the same way as you can protect libraries. The protection is applied when you encrypt the classes.
For more information, see Managing Library Protection.