In helicopter's forward motion, how is the forward pitching moment taken care off?
It's a complicated answer, with many contributing factors in a multi-dimensional matrix. In a helicopter flying at forward speed, there are several stabilising stability factors and several de-stabilising ones.


Before the helicopter can fly at speed, it needs to take off in a hover.


The rotor provides the lift force to climb.
Gravity applies down force in the Centre of Gravity.
The rotor hub is hinged - one could picture the fuselage as hanging off of the rotor hub, like a pendulum.


From this answer, own work

In this situation, hinging freely, the CoG would move directly underneath the rotor hub without re-aligning the rotor - the helicopter would stay in place, and only the fuselage would tilt until the CoG is underneath the lift vector. There is a range of allowable horizontal CoG positions, which would result in a range of fuselage angles when climbing up in a straight hover. Of course, if the CoG is chosen excessively forward or rearward, this scenario would result in an impossible fuselage angle.
But the rotor hub hinge does transfer torque, from rotor to the mast and vice versa. The fuselage is not free to dangle underneath the hub. From Prouty, Helicopter Performance, Stability and Control:, describing behaviour in a vacuum:



The teetering rotor in a vacuum has no tendency to align the rotor and mast perpendicular to each other, while the very common hinge offset rotor does. And in the atmosphere, the teetering rotor also wants to align the mast perpendicular tp itself via the torque of the flapping effect described here.

So a helicopter taking off in a hover with the rotor horizontal, aligns both the fuselage and the rotor until the CoG is underneath the lift vector. If the CoG was not exactly underneath the hub centre, the fuselage rotation tilts the lift vector and the helicopter starts to drift, which needs to be compensated by cyclic stick input from the pilot. From FAA Rotorcraft Flying Handbook, Chapter 7 Weight and Balance:


  CG FORWARD OF FORWARD LIMIT. You can recognize this condition when coming to a hover following a vertical take-off. The helicopter will have a nose-low attitude, and you will need excessive rearward displacement of the cyclic control to maintain a hover in a no-wind condition.


Note that the above means that the rotor wants to align to the forward lean of the fuselage, which tendency must be compensated for by rearward cyclic.
In order to fly forward the pilot moves cyclic longitudinal forward, effectively tilting the rotor disk forward. As seen above, this also tilts the fuselage forward, moving the CoG to a new position further aft - this creates a nose-up moment, compensating for the nose-down moment of the thrust/drag torque.

When the helicopter picks up forward speed, air pushes at the fuselage: there is parasitic drag. This wants to tilt both the fuselage and the rotor further forward. 





At increased airspeed, the rotor flapping provides an increased nose-up torque: the forward moving blade experiences higher lift at higher speed, and reaches a higher tip position when pointing forward. As explained in 2. above, this results in a fuselage nose-up moment as well due to the hinge coupling between rotor disk and fuselage.
The helicopter trim angle at speed can be further influenced by incorporating a horizontal tail, which applies a nose-up torque at speed. The horizontal tail incidence is often variable, in order to provide a wide range of stabilising moments at cruise speed, high angle descent etc.

The horizontal tail in cruise usually has a negative angle of attack, and is designed to make optimal use of the rotor downwash upon it. Horizontal tails are not required but highly desirable, for positive cyclic speed stability.
But a horizontal tail is ineffective in the hover, and a rotor on top has negative speed stability, as explained in this answer - the main reason for the instability in the hover of conventional helicopters, requiring constant stick inputs to maintain position.


Summarising, the nose-down pitching moment at forward speed is compensated by:


The flapping angle of the rotor disk.
The hinge moment coupling, either from hinge offset or from aerodynamic coupling in case of a teetering rotor. This effect wants to keep the rotor mast aligned perpendicular to the rotor.
The horizontal tail.
The useable horizontal range of CoG location.
And not mentioned above: in some cases canting of the tail rotor.