You mentioned you can't find custom query, in which folder? Team Query or My Query, anyway if you mean my Query, you will need to write code like the following:
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://TFS2011:8080/TFS/DefaultCollection"));
var workItemStore = tfs.GetService<WorkItemStore>();
var queryHirerarchy = workItemStore.Projects[5].QueryHierarchy;
foreach (QueryFolder query in queryHirerarchy)
{
Console.WriteLine(query.Name);
}
But remember My team Queries will be per login credential 
Thanks
M.Radwan