I found the problem. The interface was being deleted when AppB disconnected even though the MFC document that implemented it was still alive. I had delved fairly deep in the MFC code and not found anything but it must be happening somewhere in there.
I AddRef'd the interface in the doc constructor and Release'd it in the destructor and the problem was solved.