The Bucks also got a second-round draft pick from the Warriors, giving up guard Charlie Bell and center Dan Gadzuric in return.
Maggette played in 70 games with 49 starts for Golden State last season, averaging 19.8 points per game. He will be expected to provide offense for a team that may lose John Salmons, who can opt out of his contract and become a free agent.
"Corey has been a consistent scorer throughout his career," Bucks general manager John Hammond said in a statement. "He shoots a solid percentage from the field and has shown the ability to get to the free throw line. We're looking forward to having him in a Bucks uniform."
Tuesday's deal leaves the Bucks with three selections in the second round of Thursday night's NBA draft.
Maggette, an 11-year veteran, ranked 19th in the league in field goal percentage (.516) last season and had the league's highest scoring average for a player who logged fewer than 30 minutes per game. He has three years and approximately $31 million remaining on his contract.
Bell played in 71 games with 39 starts for Milwaukee last season, averaging 6.5 points, 1.5 assists and 1.9 rebounds per game. Gadzuric appeared in 32 games with six starts, and averaged 2.8 points and 2.9 rebounds in 9.8 minutes per game.
"Charlie and Dan are two high-character veterans who can provide us with some of the intangibles that we need on our squad," Warriors general manager Larry Riley said in a statement. "They are both experienced veterans who will be welcomed additions to our very young team. Additionally, while we certainly wish Corey well and thank him for his outstanding contributions the last two years, this will help alleviate a log-jam that we have at small forward and, more importantly, power forward, where we expect both Brandan Wright and Anthony Randolph to return from injuries and play an increased role on our team next season."
Gadzuric will make $7.2 million in the final year of a massive contract that Hammond inherited from the team's previous front office. Bell will make just under $8 million for the next two seasons.
Bell was generally well-liked by Bucks fans but had a few uncomfortable moments with the team. Earlier this year, he was benched in Game 7 of the Bucks' playoff series against Atlanta for disciplinary reasons. Bell also bristled when the Bucks matched an offer sheet from the Miami Heat in 2007.
Bell thanked Bucks fans in a post to his Twitter account, writing, "Thanks Bucks fans for all your support over the years. We had our good times and bad but I will always love the city of Milwaukee."