IN THE REALM OF THE SENSES (Ai No Corrida) directed by Nagisa Oshima.
It's a Japanese movie that was directed in 1976 and is the first non porn movie I know of that has the actual actors performing real sex acts on screen. Furthermore all the sex in the movie is integral to the plot. The movie caused quite a controversy when it was released and was banned in Japan. (Link to it's imdb page:
http://www.imdb.com/title/tt0074102/)
So Matt Damon isn't the first person to have this idea. Other more recent films that do this are Romance, Intimacy, and Baise-Moi (which is a French indie directed by and star two former porn stars).