Hybrid systems that use both raw materials (manufacturing mode) and returned products (remanufacturing mode) as a supply for their production process are considered. The system studied consists of one facility that necessitates setup for switching from one production mode to another. As in industrial practice, the flow rate of returned products is usually below the market demand, switching from one mode to another is unavoidable for meeting the demand. Therefore, determining the optimal production and setup policies is critical for effectively planning production process and reducing the manufacturing cost. Evaluating system performance, we take into account production costs in manufacturing and remanufacturing modes, serviceable and return inventory costs, backlog and setup costs. We present first an analytical solution for optimal production and setup schedule along the production cycles, considering the case of reliable systems. These cycles are shown to contain intervals of production at maximal rates as well as on-demand manufacturing and on-return remanufacturing. Next, for failure-prone systems, the optimality conditions in the form of Hamilton-Jacoby-Bellman (HJB) equations are developed. Solving HJB equations numerically, the optimal production and setup policies are calculated, and it is demonstrated that the optimal trajectories converge to the production cycles) of the type determined analytically beforehand. The sensitivity analysis of the obtained solutions (both analytical and numerical) over system parameters is presented to validate the proposed approach and demonstrate the robustness of the results.