Les Trois Mousquetaires was one of the series of works that Dumas wrote in collaboration with Auguste Maquet. The name of the latter was apparently omitted on the insistence of publisher, and at one point Maquet did unsuccessfully sue Dumas for the co-authorship and royalties. French version of the Wikipedia article on Maquet contains an extended discussion of whether Maquet was the real writer or whether it was a genuine collaboration - it seems that Maquet write the principle story line, whereas Dumas extensively reworked the dialogues and other details. However, just as Dumas, Maquet was a fiction writer, rather than a specialist in history of the period in question. He also collaborated with Dumas on works placed in other historical periods, notably The Count of Monte Cristo.
Charles de Batz de Castelmore d'Artagnan was the real protagonist, whose biography was written in teh forme of memoirs by Gatien de Courtilz de Sandras' as Les mémoires de M. d'Artagnan.
Many other heros of the novel are real persons - certainly the King and the Queen, the cardinal, M. de Tréville and other well-known personalities, as well as the three musketeers themselves. However, the story behind is quite improbable and the political realities are significantly distorted - e.g., King is presented as weak, Rechelieu as running the show, Queens as actively interfering in politics - none of which was quite true.
Dumas also took many liberties with chronology - e.g., the real d'Artagnan was born in 1615, and consequently would have been too young to participate in the siege of La Rochelle, 1627-28. It is also worth noting the real Porhos, Athos and Aramis were all younger than d'Artagnan:
Confusion encore entretenue par le fait que d'Artagnan finit maréchal de France dans Le Vicomte de Bragelonne, contrairement à Charles de Batz qui mourut en 1673 au siège de Maastricht, mais comme son cousin germain Pierre de Montesquiou d'Artagnan. Mais Dumas modifie son âge en 18 ans en avril 1625 et donc le fait naître au premier trimestre 1607 ou au deuxième semestre 1606 ; il le fait mourir en Hollande vers le milieu de l'année 1666, à l'âge de 59 ans.
Confusion further maintained by the fact that d'Artagnan ended up Marshal of France in Le Vicomte de Bragelonne, unlike Charles de Batz who died in 1673 at the siege of Maastricht, but like his first cousin Pierre de Montesquiou d'Artagnan. But Dumas changes his age to 18 years in April 1625 and therefore makes him born in the first quarter of 1607 or the second half of 1606; he had him die in Holland around the middle of 1666, at the age of 59.
The principle line of the story about the Queen's affair with Buckingham is also quite improbably, although Dumas took care not to link it to any real events (something ignored by the creators of the recent film The Three Musketeers: D'Artagnan, where the events do not withstand an elementary fact-check - like an attempted public assassination attempt against the King, during his brother's marriage.
It is hard to judge whether the manner of speaking and the depictions of life are are close to the historical period described. Again, they are certainly less distorted than in more recent adaptations of the novel.
Les mensonges de l'Histoire: Les trois mousquetaires de Dumas, roman fidèle à la réalité historique.