Dan Brown's The Da Vinci Code (2003) has many similarities to an earlier best-seller: Michael Baigent, Richard Leigh, and Henry Lincoln, The Holy Blood and the Holy Grail (London, 1982).
Unlike Brown's book, which is a novel, those three wrote their book as non-fiction. They argue that Jesus married Mary Magdalene, had several children, and their descendants moved to the south of France. There they intermarried with the local grandees and eventually became the Merovingian dynasty, which ruled the Frankish kingdom from the middle of the 5th century to the middle of the 8th century. The interests of Jesus's kin are now protected by a secret society called the Priory of Sion, which aims to establish a new Holy European Empire ruled by one of the descendants of the Son of God. The Holy Grail comes into it too, somehow.
According to the narrative, the Roman Catholic church tried to murder all of these rivals, which is why they were so keen on eliminating the Cathars and the Templars during the Middle Ages. In this way they could keep the apostolic succession of Peter (the first pope) rather than the hereditary succession of Jesus and his wife Mary Magdalene.
The authors also look into the supposed mysteries connected to a village in southern France called Rennes-le-Château. The pastor of the village suddenly became very wealthy, perhaps because he found some documents proving these claims, perhaps because he blackmailed the Roman Catholic church...who knows.
Baigent and Leigh sued Random House, Dan Brown's publisher, on a charge of plagiarism. Not only does Brown's book novelize much of their research, but one of the characters is actually named 'Leigh Teabing', the word 'Teabing' being an anagram of 'Baigent'. In The Da Vinci Code, Chapter 60, The Holy Blood and the Holy Grail is actually mentioned as a source.
Baigent & Anor v The Random House Group Ltd (The Da Vinci Code)  EWHC 719 (Ch) (07 April 2006) was rejected by the High Court. In a really bizarre turn, Sir Peter Smith embedded a secret coded message in his written judgement. "How judge's secret Da Vinci code was cracked", you may ask. It wasn't hard.
The authors of The Holy Blood and the Holy Grail did not find either the judgement or the secret code amusing, so they appealed in Baigent & Anor v The Random House Group Ltd  EWCA Civ 247 (28 March 2007), also unsuccessfully. The appeals court concluded that what Dan Brown took from Baigent and Leigh 'amounted to generalised propositions, at too high a level of abstraction to qualify for copyright protection'. Not everyone would agree. But the appeals court did note that Sir Peter Smith 'was prompted by the extensive use in [The] D[a] V[inci] C[ode] of codes, and no doubt by his own interest in such things, to incorporate a coded message in his judgment, on which nothing turns. The judgment is not easy to read or to understand. It might have been preferable for him to have allowed himself more time for the preparation, checking and revision of the judgment.' That's British understatement for you...