Did you try the sample code - it works with either pre or post-selected objects.
Like I said, lights are special object and, thus, need to be treated differently than normal geometric objects. The sample code demonstrates this. Of course, attaching user text to object attributes is just fine too.
CRhinoMaterial is not derived from CRhinoObject. Thus, they do not have attributes.
User text is the easiest way to store extra data on anything. The sample demonstrates how to do this with stuff you can pick. For materials, just make a copy of the material, add your user text, and then modify the material by calling CRhinoMaterialTable::ModifyMaterial. There is a material table on the document.