The move came hours after the Brewers agreed to terms with free-agent third baseman Aramis Ramirez.
McGehee had a strong rookie season in 2009 and a big year in 2010 but slumped at the plate in 2011 and lost his starting job to Jerry Hairston Jr. late in the season. The 29-year-old McGehee batted .223 with 13 homers and 67 RBIs for the NL Central champions, a year after hitting .285 with 23 home runs and 104 RBIs.
"Casey McGehee adds a quality option for us at both corner infield positions and adds depth to our position player group," Pirates general manager Neal Huntington said in a statement.
Veras was 2-4 with a 3.80 ERA and one save in a career-high 79 games last season for Pittsburgh. He tied for second in the NL in appearances and ranked fifth with 27 holds. The 31-year-old right-hander held opponents to a .206 batting average and struck out 79 in 71 innings.
Both players are eligible for arbitration.
Veras has also pitched for the New York Yankees (2006-09), Cleveland (2009) and Florida (2010), going 14-13 with a 4.11 ERA and four saves in 255 career games -- all in relief.
McGehee is a .265 career hitter with 52 home runs and 242 RBIs in three-plus major league seasons. He was chosen by the Cubs in the 10th round of the 2003 draft and made his big league debut with Chicago on Sept. 2, 2008. Milwaukee claimed him off waivers on Oct. 29, 2008.
The Brewers also finalized their one-year contract with free-agent shortstop Alex Gonzalez, a deal that includes an option for 2013 that could become guaranteed.