Manual work is the key source of skill and ingenuity in industrial manufacturing. At the same time, it is the most expensive resource factor. Often machines can replace humans for more effective manufacturing because machines outperform humans in terms of strength, precision and endurance. Humans, however, perform better than machines when flexibility and intelligence is required. Flexible Manufacturing Systems are capable of manufacturing wide variety of products with low volume size and minimal lead time. These manufacturing cells are usually equipped with high level computer based control and include highly flexible industrial robots also. Robots can partially resolve contradiction of flexibility and intelligence due to their more humanlike structure and programmability. To a large extent, robots have already relieved workers of many of the tedious, hard and unhealthy parts of industrial work. But the universal application of robots in small-batch highly customized production is hindered by the time consuming robot programming. This thesis shows efficient methods and processes for teaching and optimizing complex robot tasks by introducing cognitive robot programming, flexible robotics, and middleware. Intelligent user interfaces combining information from several sensors in the manufacturing system will provide the operator with direct knowledge on the state of the manufacturing operation. Thus, the operator will be able to determine the system state quicker. Sensory system calculates and proposes the optimal process settings. The key element is the new cognitive human-machine communication channels helping the operator to comprehend the information from the sensory systems. Novel middleware technology is facilitated for integration of elements from different system platforms into a coherent robot system and scaling it for different hardware complexity levels. The contributions of the thesis could be summarized as follows: 1. Introduction of a new scientific concept of task dependent, software component based controller for flexible manufacturing cells. 2. Development of a new paradigm of robot teaching and supervising, which opens a new dimension of robotization in the area of small and medium sized enterprises. 3. Introduction of a new concept for Coginitve Telemanipualtion.