I'm also working on a GUI for pari/gp. I started with mathGuide from which I removed the Python plugin. I call gp in application mode, not in library mode.
I use most of the code of gp.c and I redirect the output to a global string. Maybe not the best way, but it's easy to code and it work.
For now, my new code is source compatible only. All the modifications have been include in #ifdef/#endif so the "original" gp compile and work with no modification.
Still many hours before it will work correctly. I use Qt so it must be possible to port it on many OS. I only tested it on Linux. Here a screenshot :