I'm not sure about the object name and the Field Name. I tried but i think "ApexClass" is not the right object to call apexclass from a permission set.
Here is the query
[Select Id, Name From ApexClass] but its not giving the enabled classes in a permissionSet.
Thanks in Advance
Best Answer
You can use SetupEntityAccess and Apex class to get required information.
First SOQL will show all apex class Ids which is enabled for permission set 'CustomPermission'.
Second SOQL will show Apex Class Name based on first query result.