Spin-transfer torques in layered structures are studied with particular attention to their direction. Their direction is in spin valves determined mainly by the properties of the free layer and its interfaces. Situations which lead to a significant component of the torque in the direction perpendicular to both magnetizations present in the spin valve (out-of-plane torque) are described and analyzed. This component may arise from the transmitted spin current, as is demonstrated for a Cu vertical bar Ni vertical bar Cu(001) based system, or from the reflected spin current, which is found to be particularly high for systems with Cr vertical bar Co2MnSi interface. Ab initio calculations were performed for these systems employing the local spin density approximation (LSDA) and the linear muffin-tin orbital (LMTO) method. Information about the direction of the torque was obtained from the spin-mixing conductance.