In this paper, we consider the optimal control problem for stochastic system driven by fractional Brownian motion with Hurst parameter H>1/2 and standard Brownian motion. The state equation is described by stochastic differential delayed equations involving both delays in the state variable and the control variable. We obtain the maximum principle for optimal control of this problem by virtue of the duality method and the anticipated backward stochastic differential equations. As an application, the linear quadratic case is investigated to illustrate the main results.