This short blog show you how to fix the error you might have when following a msdn article for Outlook Add-in.
If you are following this article How to: Programmatically Search for a Specific Contact https://msdn.microsoft.com/en-us/library/ms269001.aspx
You might hit the error “Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘Microsoft.Office.Interop.Outlook.ContactItem” When you reach the following code.
foreach (Outlook.ContactItem foundContact in searchFolder)
What you need to do is to change the foreach loop like the code below.
foreach (Object foundContact in searchFolder)
if (foundContact is Outlook.ContactItem)
contactItem = (Outlook.ContactItem)foundContact;
That works for me.