One method of keeping the console open after launch is to use a console application to launch the GUI application.
This serves two purposes. First, the console application is capable of waiting on the GUI process handle, and the GUI process is then able to use AttachConsole to just attach to the console application's console.
A better option is to use STARTUPINFO in CreateProcess to provide a set of handles to be used. One possible use could be to provide a set of anonymous pipes to the GUI process to monitor what is written. If the host console application detects that something is written to stderr, then the host console application can mirror the output to stderr, but then also keep the console alive when the GUI application exits. This allows you to have a pretty nice user experience.
It is possible to tune this a bit so that this could be used for debug builds or only trigger when launched through the host console application, but the end user experience will not see the console.