This is an FAQ:
http://www.opencascade.org/needhelp/faqadda.html
I myself directly pirated the source from TTOPOLOGY and BRepTest to make this mini-application for just such a purpose
ftp://ftp.freeengineer.org/pub/misc/userdraw.tar.gz
hope this works for you.
cliff