Optimality systems for different classes of optimization problems in Banach spaces can be formulated as generalized equations. This is one of the reasons why they have attracted increasing interest in the optimal control theory. In particular, this refers to the control of partial differential equations, where results, known from the case of ordinary differential equations, were extended to PDEs. We shall explain the use of generalized equations to establish optimality systems for optimal control problems. Moreover, their application to the analysis of control problems is adressed. In particular, the numerical analysis of Lagrange-Newton-SQP methods and the stability of optimal solutions with respect to perturbations are discussed.