If you want to lose weight, quickly, don't do swimming. Swimming will eventually get you to that ripped area like most proffessional swimmers, but you have to realize those guys swim insane amounts of hours. I swam in college, and it takes a long time to lose even 5 pounds.
However, if you want, here are some guidelines:
Swimming is like any other exercise, in otherwords, you'll want to work out hard, spending more than an hour in the pool is probably going to be detrimental to building muscle mass.
Your workout will vary depending on time, energy, and desire not to hate your life, some notes:
-Butterfly is the most intense stroke, if you want to build muscle, swim this. You should know how to do it though, otherwise you will get laughed at.
-Breaststroke can be just as hard, however, you have to have some skill at this stroke to make it so, otherwise its just a lazy person stroke. I wouldn't suggest doing this unless you know what you're doing.
-Freestyle/backstroke are basically the same, backstroke recommended if you have issues with breathing. Freestyle will be what you do most of if you're not sure of how good you are.
Here is what I would do:
1000 yard warm up (400free, 300breast, 200 back, 100 fly)
To lose weight (although it will be slow going):
10 x 100 (yard) Freestyle on 1:30
5 x 50 Freestyle on 50
10 x 100 yard Freestyle on 1:25
(I have no idea how good you are, but you should feel out what you can get down to, most college swimmers can get down to repeats 1:05's)
To build muscle:
10 x 50 Butterfly (Building to Hard) on 1:00
5 x 50 Freestyle on 1:00 (Easy)
10 x 50 Butterfly (All out)
5 x 50 Freestyle on 1:00 (All out)
200 yard cool down
It does really depend on how good you are though, swimming is strange because designing sets for people doesn't ever work out unless you know their skill level. That said, if you do these things you should be well on your way to what you want.