When an error is passed from COM to managed code, the runtime populates the exception object with error information. COM objects that support IErrorInfo and return HRESULTS provide this information to managed code exceptions. For example, the runtime maps the Description from the COM error to the exception's Message property. If the HRESULT provides no additional error information, the runtime fills many of the exception's properties with default values.
If a method fails in unmanaged code, an exception can be passed to a managed code segment. The topic HRESULTS and Exceptions contains a table showing how HRESULTS map to runtime exception objects.