Thank you to everyone who replied. The issue with the code sample I provided was that it didn't call CoInitialize(), which I forgot to include. The issue with my program itself was that there was an object that held a ID2D1Bitmap* that was created with the IWICImagingFactory and stored in static memory. The problem was that the bitmap was being released after the IWICImagingFactory, which caused a seg fault.