To whom is "Anshei ha'Milchamah" referring?
Rashbam: It refers to all the men of the generation that left Egypt who were over twenty and eligible to be conscripted. 1
And the Torah inserts it in order to teach us that the decree was confined to men between the ages of twenty nd sixty (Oznayim la'Torah).
How will we reconcile the thirty-eight years mentioned in the current Pasuk with the forty years mentioned in the initial decree (in Sh'lach-L'cha, Bamidbar, 14:33)?
Oznayim la'Torah: Because, Hashem in His mercy, included the two years prior to the sin of the Meraglim in the forty years.
The Torah already mentioned that the generation was complete - that all those from the old generation had died - by the death of Miriam (in Nisan) and by the death of Aharon (in Av). Why does it write here "Ad Tom Kol ha'Dor (Vayedaber Hashem elai" - Pasuk 17)?
Oznayim la'Torah: Granted, the old generation had already died the preious year - and Hashem simply recorded the facts that He knew - but Yisrael did not know it until the fifteenth of Av, when they rejoiced. Until then, they were sad because they thought that fifteen thousand men were still destined to die that year, 1 and the Shechinah does not rest on people who are sad.
But Hashem repealed the decree and they all lived. See Oznayim la'Torah.