How to add rotation to bone during animation in C++?

Why do you need to do it on code? You can also look at the source for modify bone which is AnimNode_ModifyBone.cpp and incorporate that.