You have two options when you decide to write your own file viewer: you can take the really hard way and use C, or you can use MFC version 3.1 or later and let MFC do a lot of the grunt work for you. Since one of the rules I live by is Don't do anything that you can get someone else to do for you, I chose the MFC method. If you want to do all the work yourself, you aren't out of luck: the FILEVIEW sample in the Win32 SDK demonstrates exactly what you have to do to reinvent that wheel.
When I wrote the MFCVIEW sample, I followed the steps outlined in a technical article by Nigel Thompson, MFC/COM Objects 1: Creating a Simple Objectmsdn_house1(available on the Microsoft Developer Network Development Library CD), and the information in Technical Note 38: MFC/OLE IUnknown Implementation (one of the MFC technical notes found in the Visual C++ documentation). So if you think the steps look familiar and you've read Nigel's article recently, you'll know why.
Here is what I did to create Nancy's Viewer: