Are there any libraries (preferably open-source) for parsing AutoCAD files (DWG or DXF)?
Don't think you will find anything better than DWGdirect. Look here
http://www.opendwg.org/
and specifically here:
http://www.opendesign.com/the_oda_platform/dwgdirect