With the release of the film Iron Man, Marvel started releasing movies under their own Marvel Studios banner. This marked a change as all previous Marvel comic book films were made and financed by other studios who licensed Marvel properties. Marvel has released these films via Marvel Studios:
- Iron Man
- The Incredible Hulk
- Iron Man 2
- Captain America: The First Avenger
These films compromise the canon that leads up to The Avengers, and are all part of a shared universe. Each film has a post-credit scene that builds upon this shared universe (excepting The Incredible Hulk; due to the immense success of Iron Man, Marvel had the post-credit scene include Robert Downey Jr's Tony Stark appear, and had the scene occur before the credits).
The question's spoiler builds upon the ending of The Incredible Hulk, which has Banner
accept that he can't get rid of the Hulk. So he starts to induce 'Hulk episodes' and stop trying to perpetually suppress him. The climactic battle of the film has Banner essentially use the Hulk as a weapon against the film's villain. During this battle, the Hulk and the Abomination destroy a good chunk of Harlem, which is explicitly called-back to in dialogue in Avengers.
Unfortunately, The Incredible Hulk's Edward Norton couldn't or wouldn't return for The Avengers, so he is replaced by Mark Ruffalo in The Avengers and future films.
Prior Marvel movies include the X-Men films (which Fox makes), Fantastic Four (also Fox), Daredevil (Fox again), Blade (New Line Cinema), Spider-Man (Sony; and this covers both the completed trilogy, and this year's reboot), and Hulk (the 2003 one, which Universal made. Universal partnered with Marvel for the later The Incredible Hulk). That's not a complete list, quite a few movies were made when Marvel was licensing out their characters. Interestingly, Fox's license to the X-Men means that they can use the characters Scarlet Witch and Quicksilver (Magneto's kids) as mutants and in relation to Magneto, meanwhile Marvel can use them as Avengers, so long as they don't mention mutants or Magneto (cite).