A new approach to the solution of optimal control problems for mechanical systems is proposed. It is based on a direct discretization of the Lagrange-d'Alembert principle for the system (as opposed to using, for example, collocation or multiple shooting to enforce the equations of motion as constraints). The resulting forced discrete Euler-Lagrange equations then serve as constraints for the optimization of a given cost functional. We numerically illustrate the method by optimizing a low thrust satellite orbit transfer as well as the reconfiguration of a group of hovercraft in the plane.