Note: I was asked to create an app that extracts .msg files from a .pst file preferably in MFC. I was informed that they have tried to use other 3rd party apps but they all fail
MSG .NET (C# library). It does exactly what you need, extract all messages as .msg files from a .pst file.