If I understand correctly, you're looking for one Query to query Apex Classes and Apex Pages in one Query? That being the case, ApexPage and ApexClass objects are not related in anyway so you won't be able to do it in one SOQL query.
You will have to query one, and then the other - it is conceivable that you will have a Page and a Class with the same name.
String searchTerm = '%itemname%';
List<ApexPage> pages = [Select Name From ApexPage Where Name Like :searchTerm];
List<ApexClass> classes = [Select Name From ApexClass Where Name Like :searchTerm];
If you're looking for the Controller for a given page, you can include the ControllerKey column in the query on ApexPage:
List<ApexPage> pages = [Select Name, ControllerKey From ApexPage Where Name Like :searchTerm];
Which would at least give you the apex class name for a Controller on the page.