I ran into a problem today trying to retrieve records filtering on an Entity Reference field using the OData endpoint. Thanks to Jim Daly for helping me. An Entity Reference field contains several properties and Id is one of the its properties. Usually when you are filtering using OData, all you have to do is use the keyword $filter, the search field, operator and the value.
For example, to retrieve all the accounts where address1_city equal Redmond, you’ll do the following:
/AccountSet?$filter=Address1_City eq 'Redmond'
AccountSet?$filter=PrimaryContactId/Id eq (Guid'567DAA8F-BE0E-E011-B7C7-000C2967EE46')