Downey plays small-time hood Harry Lockhart, who is mistaken for a great method actor and brought to Los Angeles for a big-time screen test; Kilmer plays gay private detective Perry Van Shrike (aka "Gay Perry"), who has to teach Harry how to act like a real investigator. It probably won't surprise anyone to learn that the two become involved in a very dangerous case that ends up threatening their lives and trade witty banter while trying to beat the bad guys. But Black knows the formula well, and via Downey's narration, he lets you know that he knows it, subverting things every once in a while just for a laugh. This is very much a screenwriter's movie: Not only does Harry talk and talk and talk, but most of the dialogue feels like the sort of stuff a smart writer might try to insert into an action flick, only to be overruled by studio suits. There's also ample casual nudity from most of the actresses, which could be a reaction to studio films in which such things must be carefully negotiated with big-name stars.
The screenplay is "based in part" on a pulp detective novel by Brett Halliday, but very loosely. Halliday died in 1977, and this film is very much about contemporary Hollywood, with narration that's self-aware: "My name is Harry Lockhart, I'll be your narrator," offers Downey, following soon after with, "I don't see another goddamn narrator, so pipe down." Later, he will apologize for the blatant foreshadowing contained in one scene and actually issue screen directions to characters who appear in a flashback ("Hey, I have an idea: Why not put these two extras in front of the mammoth fucking lens! Boo! Scat!" They hear, and they move). Such postmodernist commentary can be really annoying in the wrong hands (five words: "My name is Domino Harvey"), but here, the delivery and the writing make it work. Who can resist a narrator who casually drops lines like, "I was wetter than Drew Barrymore at a grunge club"?
The plot gets so complex that summing the whole thing up here would be difficult, and unnecessary, but here are the basics: Harry tags along with Perry on a real case in order to learn how to be a P.I. before his big screen test, in which he'll play one. But what ought to be a routine surveillance turns into a murder case, and Harry's nervous ineptitude needlessly screws up things. Meanwhile, Harry runs into the girl he always had eyes for in high school, an actress named Harmony Faith Lane (Michelle Monaghan). When Harmony's sister turns up dead in an apparent suicide, Harmony turns to Harry for help, thinking he's a real detective. Wanting the woman of his dreams to stick around, Harry doesn't say no. And just like in the "Jonny Gossamer" pulp detective novels Harmony and Harry are big fans of, the dead sister case and the other murder case turn out to be related.
As complex as the story twists are, however, it's the throwaways that Black seems to have the most fun with. An action figure stolen by Harry before Christmas is later revealed to be from a canceled TV show, whose star showed up drunk in Harmony's house by accident (shades of Downey's real life there). A fake beer commercial that's Harmony's only acting credit shows up a time or two. Perry refers to a small firearm as his "faggot gun" because "it's only good for a couple shots, then you gotta drop it for something better." The fact that Kilmer's gay voice sounds vaguely like a Marlon Brando impersonation only adds to the joke for Dr. Moreau fans (all three of them). Late in the film, there's an admonition to Times Square cinemagoers not to yell at the screen and, at the end, an apology to Midwest viewers for excessive use of the f-word.
Much of the humor does feel specific to L.A., so it may be that the movie won't play as well in other cities, but the zingers come so fast and furious that if you miss a few (and even the most alert viewer will the first time), there are always more.