High-order frequency locking phenomena were recently observed using semiconductor lasers subject to large delayed feedbacks [1,2]. Specifically, the relaxation oscillation (RO) frequency and a harmonic of the feedback-loop round-trip frequency coincided with the ratios 1:5 to 1:11. By analyzing the rate equations for the dynamical degrees of freedom in a laser subject to a delayed optoelectronic feedback, we show that the onset of a two-frequency train of pulses occurs through two successive bifurcations. While the first bifurcation is a primary Hopf bifurcation to the ROs, a secondary Hopf bifurcation leads to a two-frequency regime where a low frequency, proportional to the inverse of the delay, is resonant with the RO frequency. We derive an amplitude equation, valid near the first Hopf bifurcation point, and numerically observe the frequency locking. We mathematically explain this phenomenon by formulating a closed system of ordinary differential equations from our amplitude equation. Our findings motivate new experiments with particular attention to the first two bifurcations. We observe experimentally (1) the frequency locking phenomenon as we pass the secondary bifurcation point, and (2) the nearly constant slow period as the two-frequency oscillations grow in amplitude. Our results analytically confirm previous observations of frequency locking phenomena for lasers subject to a delayed optical feedback.