Hmmm.. i'm new to OpenGL as well.. it sounds like you are looking for heirarchies.(i can't spell)... like a arm ... with shoulder/elbow/wrist/fingers that would move together or independently... why not just use a couple of MATRIXS to solve your problem?
Code:
pushMatrix();
rotatef(bardegrees, 0, 1, 0);
pushMatrix();
translatef(-1, 0, 0);
rotatef(box1x, 1, 0, 0);
rotatef(box1y, 0, 1, 0);
rotatef(box1z, 0, 0, 1);
drawbox(); // Draw first box here.
popMatrix();
pushMatrix();
translatef(1, 0, 0);
rotatef(box2x, 1, 0, 0);
rotatef(box2y, 0, 1, 0);
rotatef(box2z, 0, 0, 1);
drawbox(); // Draw second box here.
popMatrix();
popMatrix();
increase bardegrees to rotate both boxes (the bar)around y-axis..
increase box1x, box1y, box1z to rotate box1 independently
increase box2x, box2y, box2z to rotate box2 independently
P.S. if you want an easy challenge on learning heirarchies building a solar system is a good idea.. sun with planets revolving around at different periods and moons revolving around planets.. i found it a very useful thing to do to learn this stuff..