This can be accomplished via special buffer file, as stephen
and others sugessted. The long-running program should update the file periodically, and the shell will read the file and insert the contents into the prompt.
Another way will let you avoid periodic writes of current progress and employs fifos or named pipes. This isn't easier to implement and won't probably run much faster, but is indeed a different way to do it.
You should arrange a progress-writer thread (or process, but this will make the whole thing even more evil) which will just write current progress into a fifo in an endless loop. Remember, if there's no reader on the other end of the fifo, then the writer will block until the reader emerges.