Let's assume you are working on Windows. In this case, you cannot consider Microsoft a 3-rd party and can use the library from Microsoft.
You may not have Office installed. So, if you only want to work with some office documents, you can use Open XML SDK:
http://www.microsoft.com/en-us/download/details.aspx?id=30425[
^].
This way, you can support new XML-based Office formats (such as .DOCX, .XLSX), ECMA-376 standard:
http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats[
^],
http://en.wikipedia.org/wiki/Office_Open_XML[
^].
This way, you can work with Office documents and create DOCX files. With PDF, without a 3rd-party libraries, you would have to do much more work by yourself. Let's see:
http://en.wikipedia.org/wiki/PDF[
^].
You would need to use just the standard and create all the software by yourself. Look at the links in the article referenced above. In principle, it's possible. But even the official ISO 19005-1:2005 standard is chargeable:
http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=38920[
^].
Good luck,
—SA