In the original Yu-Gi-Oh! ("Game King") manga, there are two story arcs in which the characters play tabletop role-playing games that are inspired by the author's experiences playing D&D, Monster World and the final Millennium World arc. Also, at one point in the story, Yugi is forced to play a game called "Dragons, Dice, & Dungeons" (Dungeon Dice Monsters in the anime and English manga), which is obviously a direct Shout-Out to Dungeons & Dragons in name.
In the Duelist Kingdom story arc, the Magic & Wizards card game (based on Magic: The Gathering) gains even more RPG-like elements due to the Duel Box field system. One instance had Yugi command one of his monsters to attack the darkness.
In Joss Whedon's Fray, a flashback page is shown while Earth-before-humans is described as a savage time filled with monsters and demons. The landscape shown is populated with the first few pages of the first edition D&D Monster Manual, including an Anhkheg, a Bullete, and so on.
In the short story "Same-Day Delivery" by Desmond Warzel, the phrase "blue bolts from the heavens" appears twice; this is a direct Shout-Out to first-edition Advanced Dungeons & Dragons; specifically, the Dungeon Master's Guide.
The web-novel Domina has a long, long list of D&D shout-outs. Most obvious is that most of the demon warlords are named after the princes of the Abyss, while the vampire ones are largely named after the dukes of Hell. Graz'zt, Obox-ob, Pale Night, Malcanthet, and Orcus for the demons, and Bel, Dispater, Mammon, Belial, Glasya, Mephistopheles, and Asmodeus for the vampires have all been mentioned—in addition to other characters like Obould (Forgotten Realms) and Abigor, Bileth, and Zepar (the warlords in charge of Maladomini).
Terry Pratchett was a D&D player, and liked to incorporate elements and references to the game, especially in the early novels which focused on fantasy parody (as opposed to the broad satire of later books). Perhaps most notably would be in The Colour of Magic, where the game the gods play with the lives of men appears to literally be Dungeons and Dragons, and the sound of dice proceeds random encounters.
Thunder rolled. It rolled a seven.
Live Action TV
Community has two episodes when center around the game, "Advanced Dungeons & Dragons" and "Advanced Advanced Dungeons & Dragons". In both cases, the study group attempts to use the game to help somebody with personal issues, but their dysfunctional nature and lack of knowledge about D&D means it doesn't quite turn out as planned.