A quick Google search solves this question.
Pausing at the tomb of Gilbert du Motier, Marquis de Lafayette, he [John J. Pershing] was reputed to have uttered the famous line "Lafayette, we are here," a line spoken, in fact, by his aide, Colonel Charles E. Stanton.
That statement cites http://www.unc.edu/depts/diplomat/AD_Issues/amdipl_16/edit16_print.html as the source. Here is a quotation
it was not General Pershing who pronounced it [the quote in question], even though he was present for the occasion and made brief remarks. Rather, it was an aide — the general’s “designated orator,” Colonel C. E. Stanton. “What we have of blood and treasure are yours,” Stanton intoned. “In the presence of the illustrious dead, we pledge our hearts and our honor in carrying the war to a successful conclusion.” And then the final line of his speech: “Lafayette, we are here!”
This page cites Black Jack: The Life and Times of John J. Pershing (1977), vol. II, 724 by Frank E. Vandiver.
The Wikipedia page on Stanton says
On July 4, 1917 he visited the tomb of French Revolution and American Revolution hero Marquis de La Fayette and (according to Pershing) said, "Lafayette, we are here!" to honor the nobleman's assistance during the Revolutionary War. The famous quote is often misattributed to Pershing.
Wikipedia cites George, John H. and Paul Boller's They Never Said It (1989)
Most of the evidence that Stanton said the quote in question comes from Pershing himself, who denied that he authored the phrase.
In My Experiences in the World War, published thirteen years after the Armistice, Pershing wrote that he could not recall having said "anything so splendid." http://notorc.blogspot.com/2006/06/did-they-really-say-that-q_114981062366646684.html
There is some evidence (although much less credible) that Pershing did in fact say this phrase first.
Despite Pershing's disclaimer, Naboth Hedin, a 33-year-old uniformed American war correspondent, asserted that he heard Pershing pronounce the famous words three weeks earlier on June 14th, the day after the American general arrived in Paris. Hedin said Pershing stepped up to Lafayette's tomb, saluted smartly and said in a loud voice, "Lafayette, we are here." Hedin insisted, "I was about twenty feet away." http://notorc.blogspot.com/2006/06/did-they-really-say-that-q_114981062366646684.html
However, the article I just cited seems to be the only place that gives credence to Pershing saying the phrase. However, the article doesn't even cite any sources.
I would conclude that Col. Charles E. Stanton himself said the phrase, "Lafayette, we are here".