// Make "first" the current database.
AcDbDatabase *pDbFirst = new AcDbDatabase(Adesk::kFalse);
pDbFirst->readDwgFile("first.dwg");
// Now make "second" be the current database.
AcDbDatabase *pDbSecond = new AcDbDatabase(Adesk::kFalse);
pDbSecond->readDwgFile("second.dwg");
// Insert "second" into "first" as ABLOCK.
Acad::ErrorStatus es;
AcDbObjectId blockId;
es = pDbFirst->insert(blockId, "ABLOCK", pDbSecond);
// Deleting "second" makes the current database NULL.
delete pDbSecond;
// Make the current database "first" again.
myHostServices->setWorkingDatabase(pDbFirst);