Objects in a block reference inherit most of their properties from the way they are defined in a block table record, with the exception of certain types of attribute definitions/references. So for example, if a polyline is assigned layer "123" when the block is created, the line will be drawn using the properties of layer "123" for all instances of a specific block when inserted into a drawing. It is possible to have objects within a block inherit the general properties of the block reference, this is done by assigning the objects within a block the value of ByBlock for a particular object property or drawing objects on Layer 0 before adding them to a block.

If you want to change the layer in which a polyline is drawn on for all instances of a block inserted into a drawing, you would open that particular block table record for reach and then iterate to find the polyline object and then modify that object.
The following is a basic code sample that should get you started with how to change the layer of a entity in a block definition using ObjectARX:
// Get the current database
AcDbDatabase *pDb = acdbHostApplicationServices()->workingDatabase();
// Open the Block Table for read-only
AcDbBlockTable *pBlockTable;
pDb->getSymbolTable(pBlockTable, AcDb::kForRead);
// Get the Model Space block
AcDbBlockTableRecord *pBlockTableRecord;
pBlockTable->getAt("MyBlockDef", pBlockTableRecord, AcDb::kForWrite);
pBlockTable->close();
// Create a new block iterator that will be used to
// step through each object in the current space
AcDbBlockTableRecordIterator *pItr;
pBlockTableRecord->newIterator(pItr);
// Create a variable AcDbEntity type which is a generic
// object to represent a Line, Circle, Arc, among other objects
AcDbEntity *pEnt;
// Step through each object in the block
for (pItr->start(); !pItr->done(); pItr->step())
{
// Use pEnt->isA()->name() to look for a specific object type
// Get the entity and open it for write
pItr->getEntity(pEnt, AcDb::kForWrite);
// Display the class name for the entity before
pEnt->setLayer("123");
pEnt->close();
}
// Close the current space object
pBlockTableRecord->close();
// Remove the block iterator object from memory
delete pItr;