Surprised more people aren't interested in this.
Guardians of the Galaxy:
-Iron Man #55: First appearance of Thanos and Drax. This could also be the basis for one of the Guardians sending a beacon to Tony if that is indeed what happens in the after credits of IM3.
-Iron Man #12: First appearance of The Controller
-Captain Marvel #28: Covers Thanos releasing The Controller from prison and contracting his services...for the record, this issue takes place during the event that led up to the first Thanos vs. Avengers conflict involving the Cosmic Cube.
-Marvel Preview #4, 7: First appearances of Star-Lord and Rocket Raccoon.
-Strange Tales #178-181, Warlock #9-11, 15: First appearance of Gamora, the Universal Church of Truth, and Magus. Leads up to Thanos' second major battle with the Avengers.
-The Thanos Quest #1-2: Covers Thanos' journey to obtain the Infinity Gems. Bare bones obviously.
-Annihilation Conquest #1-6, Star-Lord #1-4: Covers the event that led up to the Guardians first forming...doubtful much is taken from this in the film though.
-Guardians of the Galaxy v2 #1-25: Obligatory...although, again, doubtful that much of this will be used in the film, aside from things like "Ship"...and maybe Cosmo
-The Thanos Imperative #1-6: Covers the Guardians' "final" confrontation with Thanos
Avengers 2:
-Avengers #125: Thanos' first battle with the Avengers. Captain Marvel calls on the Avengers to help defeat Thanos, who has gain possession of the cosmic cube.
-Avengers Annual #7, Marvel Two-In-One Annual #2: Covers the Avengers' second battle with Thanos, who has this time formed a doomsday weapon with the Infinity Gems. This is the aftermath of the Warlock story where Gamora was introduced. Also covers Thanos' backstory more in-depth.
-The Infinity Gauntlet #1-6: Covers Thanos forming the Infinity Gauntlet, which has the power to grant him anything he wishes, which he uses to kill half the universe. This results in him fighting the Avengers and the rest of the Marvel universe.