The EROS-2 project has been designed to search for microlensing events towards any dense stellar field. The densest parts of the Galactic spiral arms have been monitored to maximize the microlensing signal expected from the stars of the Galactic disk and bulge. 12.9 million stars have been monitored during 7 seasons towards 4 directions in the Galactic plane, away from the Galactic center. A total of 27 microlensing event candidates have been found. Estimates of the optical depths from the 22 best events are provided. A first order interpretation shows that simple Galactic models with a standard disk and an elongated bulge are in agreement with our observations. We find that the average microlensing optical depth towards the complete EROS-cataloged stars of the spiral arms is $bar{tau} =0.51pm .13times 10^{-6}$, a number that is stable when the selection criteria are moderately varied. As the EROS catalog is almost complete up to $I_C=18.5$, the optical depth estimated for the sub-sample of bright target stars with $I_C<18.5$ ($bar{tau}=0.39pm >.11times 10^{-6}$) is easier to interpret. The set of microlensing events that we have observed is consistent with a simple Galactic model. A more precise interpretation would require either a better knowledge of the distance distribution of the target stars, or a simulation based on a Galactic model. For this purpose, we define and discuss the concept of optical depth for a given catalog or for a limiting magnitude.