The Bofors and the Oerklion that are in game are not used by modern armed forces anymore though both companies still make modern weapons.I know the main reason that the 40mm fell by the wayside was simply age of the guns themselves(in the US military) My step dad was a sensors operator on AC-130s back in the early 70's in later half of Vietnam he said that they where using old WWII stock for the 40mms and it was not uncommon for the rounds to jam or be duds and not explode when they hit the ground/some object.
Nowadays chain guns are the name the game of the game and in many cases smaller rounds are used but technology actually makes them more deadly than older larger ones.Even the AC-130s are getting a single 30mm Bushmaster chain gun in place of the old set up of 2 40mms.
On WWII subs most of the guns where used against surface targets and almost never against planes because trying to fight them is really suicide when you can dive to avoid them.Fleet boats ended carrying 1 40mm two or 3 20mm and 2 to 4 M2 .50cals these where all used to attack surface vessels and where very effective for suppressive fire and the 40mm could kill smaller targets in its own right.
In game you can use the 40mm against small vessels like Sampans I have killed them with the 40mm at 3,000 yds with only about 8 rounds hitting more of course to line the sights but 8 shells hitting target this is with TMO 2.1
Couple of links
best clip of the old 40mm in an AC-130 soon to be replaced with a 30mm Bushmaster:
Neat clip of a more modern but still clip(larger) feed 40mm Bofors in the AA role looks like some time in the 80s:
An old WWII 20mm just like on your boats:
A modern 30mm chain gun Oerklion this type of cannon are used for close range anti ship rather than anti air today clearly much more effective than a 60 round drum:
pic of 40mm Bofors shells as you can see the ones in game are a bit too large click the 3rd pic:
http://www.keywordpicture.com/keyword/40mm%20shells/
down the barrel:
Modern Oerklon say bye bye to a pirate vessel:
@ VonTrapp he was talking about a M2 .50 being modified to fire single rounds and mounting a scope and being used as a sniper(I think only one Marine sniper had this done for a specific target) you are thinking of the M82 Barret which is a purpose built .50 rifle not the same thing but they do use the same .50BMG caliber.The M82 was not designed until the 1980s and the M2 is still in use as a heavy MG being designed in 1921.