This paper presents a novel control architecture for humanoid robot RH-2. The main objective is that a robot can perform different tasks in collaboration with humans in working environments. In order to achieve this goal, two control loops have to be defined. The outer loop, called collaborative control loop, is devoted to the generation of stable motion patterns for a robot, given a specific manipulation task. The inner loop, called posture stability control loop, acts to guarantee the stability of humanoid for different poses determined by motion patterns. A case study is presented in order to show the effectiveness of the proposed control architecture.