A habitual grumbler.
The term was first used in a military context and alluded to firearms or sirens rather than to people.
In 1847, Claude Étienne Minié, a captain in the French Army, introduced a soft lead bullet which came to be known as the Minié (or minnie) ball (or bullet). These bullets were distorted by the action of firing them from a rifle, causing them to whirr in flight, and make a moaning sound. The are many references to minnie balls in print in the second half of the 19th century. None of them included any mention of moaning, or moaning minnie, and this is unlikely to be the source of the term.
In WWI the German Army used a type of trench mortar called a Minenwerfer. This was nicknamed the 'minnie' by the Allied forces. The first record in print of it being called that is in From the fire step - a WWI memoir by the American soldier and author Arthur Guy Empey, published in 1917:
"A German 'Minnie' (trench mortar) had exploded in the next traverse."
We don't find any mention of Moaning Minnies in WWI, although a similar term - Mournful Mary (or Maria) was coined then as the name of a type of siren. This is cited in the US newspaper The Independent, June 1918:
"The sentry... sounds 'Mournful Mary,' a siren with a sob in her voice."
This is further defined in Fraser and Gibbons' Soldier & Sailor Words, 1925:
"Mournful Maria, a nickname given to the Dunkirk syren, employed to give warning of enemy air attacks and long range shelling."
Despite all of the above, which seem not too far distant from Moaning Minnie, and the fact that it is widely thought to be a WWI term, there are no printed citations of the term until the WWII period. If it really were a WWI term the huge amount of printed records and reminiscences of the war would surely have turned up at least one reference to it. It turns out that the first known record we have of it dates from WWII and relates to an air-raid siren. That's in a novel by the English writer Robert Greenwood - Mr. Bunting in peace and war, 1941:
'One up now,' said Chris, listening to the drone of an engine. 'Hope Moaning Minnie doesn't sound, and bring mother downstairs.'
Soon after that come references to the German Nebelwerfer mortar. These were widely used by German forces in WWII and the loud screeching sound of their shells prompted US and UK soldiers to give the mortar various nicknames, including Moaning Minnie. These were recorded in a piece in The New York Herald Tribune, February 1945:
"The nebelwerfer is a six-barreled projector firing six-inch rockets... The rockets, not very accurate, are variously called 'screaming meemies' and 'moaning Minnies', but, like most Army slang terms, these names are also applied to other enemy explosives."
The term was in use to denote the mortar not later than April 1944, when it was referred to in Hutchinson's Pictorial History of War:
"When the Germans beat a hasty retreat from Cagny among the material they abandoned was this multiple mortar, or 'Moaning Minnie'."
From 1944 onward there are many documentary records of uses of the term Moaning Minnie as a name for the German Nebelwerfer mortar, but many more as the name for an air-raid siren. Moaning is clearly alluding to the sound of the devices. Why Minnie was chosen may have been in a reference back to the WWI Minnie mortars, but more likely because of the alliteration with moaning.
It seems difficult to believe that the names arose independently. If one did influence the other then which came first? Having listened to the Nebelwerfer mortar in action in WWII newsreel film clips it makes a loud and high-pitched screeching whistle - hardly something that could be described as moaning. Is is difficult to imagine coining the name Moaning Minnie for it unless that term were already in one's head. Air-raid sirens however do make a moaning noise and were called just Monas from early in the war (after the women's name Mona). It is very likely that Moaning Minnie was first used as the name for an air-raid siren and this was later adapted as a name for the mortar.
The first known figurative use of Moaning Minnie, as a pessimistic, complaining person, comes surprisingly late. The first I can find is from The Sunday Times, January 1962:
"Another said that she... 'just didn't believe these moaning minnies'."
The dancer, singer and actor Fred Astaire is said to have been nicknamed Moaning Minnie by his sister Adele, on account of his tireless perfectionism. This supposed attribution is difficult to substantiate or to date. If it is correct then it probably predates 1962.