Can you explain IUnknown interface used in COM ?

 
 

COM is an acronym for Component Object Model. COM is a way of building objects that is independent of any programming language. 
Every COM object implements an interface named IUnknown. It contains three methods:
-         QueryInterface: Returns a pointer to another interface
-         AddRef:  Increments the objects reference count
-         Release: Decrements the objects reference count.
One of the rules of COM says that given a pointer to an interface a client can call any IUnknown method through that pointer as well as any methods that are specific to that interface. Hence all interfaces must support the three IUnknown methods in addition to their own methods.