I think this is probably answerable.
The easiest answer is "Colossus: The Forbin Project" which is a semi-satirical take on the subject (filmed in 1970, based on a contemporary book). A super-computer built in the US to defend against a Soviet attack combines with its Soviet counterpart to dominate all aspects of human behavior. You can watch it on YouTube (with commercials):
This was original enough at the time to impress mainstream critics, even though it was already a hoary concept in genre fiction. It spawned (or at least heralded) numerous other computer-knows-best/computer-controlled-society films like Logan's Run, WarGames and (arguably) Tron and The Matrix.
But I'm never happy with the obvious answer if I haven't really looked back at the catalogue to see where things really started, so let's see where that takes us. I'm using IMDB, YouTube, Ed Naha's Science Fictionary and Michael Weldon's Psychotronic Video Guide as my sources.
Predating robots, "The Golem" (in its many variations) often had a theme of going amok or turning on its creator. Amok robots show up in silents and cartoons in the 10s, 20s and 30s—Mickey Mouse had a run-in with a robot! The (oft filmed) 1920 play "R.U.R." which introduced the word "robot"—and results in humanity being wiped out—was probably the tone-setter, and this tone is what Isaac Asimov ("I, Robot") was reacting to.
N.B.: Asimov is doubtless where you would go to find the purest fictional examples of benevolent-robot-over-man. He was a true believer in eventual robot superiority (see Star Trek: The Motion Picture.) Curiously none of these stories have ever been filmed, as far as I can tell, the irony of which will be apparent shortly.
By the time you get deep into the 30s, machines aren't turning on man so much as man is turning robots into war-machines, like "Loss of Sensation" (USSR) and "Master of the World" (Germany). I think this is because the computer—the "thinking" part of the robot—didn't really exist. (Robots, when they rebelled, essentially became human, and the concept of them having super-brains didn't permeate pop-culture until the '50s.)
I'd be willing to commit to 1951's The Day The Earth Stood Still as the first "live in peace or be destroyed" movie—up until then, aliens were all about conquest of earth. Although, we should give a nod to 1918's Himmelskibet where a journey to Mars, and its pacifist, fruitarian (!) inhabitants, results in a sort-of "mission to earth" without the "or else" of TDTESS.
Himmelskibet on YouTube:
But that doesn't really have the "Man vs. Machine" aspect that Dan asked for. It's really "Man vs. Alien", where the aliens have robots. I think we'll have to look a bit later.
The first inklings of "machine knows best" is perhaps "The Twonky" (1953). A guy's wife buys him a TV and the TV starts to run his life. It's adversarial and the twonky's motives are probably best considered parasitic, but it gets us a bit closer to the goal.
1956 brings us Forbidden Planet, and while we could wildly speculate the extinct Altairians had a computer-controlled society, the more relevant aspect is Robbie the Robot. Robbie—the same character!—would re-appear in 1957, in the odd and obscure film The Invisible Boy, wherein a little boy is controlled by a computer and directed to rebuild a robot (Robbie) that his father has brought back from the future where Forbidden Planet took place! The master computer plans to use Robbie to gain control of the earth. We almost have it, except the super-computer's actions are merely self-preservational and/or conquest.
Now things start to get hairier. The USSR launches Sputnik. SF Anthology series like "The Twilight Zone", "One Step Beyond", "The Unforeseen" and "The Outer Limits" start to proliferate. (There were earlier speculative fiction anthology series as well, like "Lights Out", an episode of which presaged the plot of They Live, but they tended to be more supernatural than science-fiction.)
"The Twilight Zone" has a couple of episodes that tease the Master Computer trope, all dystopic. When Burgess Meredith is declared "obsolete", no computers are involved, but this is clearly a reference to fears regarding automation and totalitarianism. The episode "Uncle Simon" has an inversion of what we're looking for (with a human forced to tend to a robot). "The Brain Center at Whipples" is another typical TZ entry where automation has (inevitably) wicked consequences.
"Outer Limits", of course, has the classic "Demon with a Glass Hand" which would become the lawsuit-winning inspiration for Terminator's Skynet.
1962's The Creation of the Humanoids gives us a world largely run by robots that live side-by-side with humans and try to help them survive (YouTube):
Not quite there, as there is freedom in action, and there's a lot of Blade Runneresque blurring of lines.
The TV Show "Out of this World" has an episode featuring a supercomputer named "Eddie". But he doesn't take things over.
And now we're coming up on Colossus's own time with 1965's Alphaville, which has a computer controlled-society. I don't recall any utopian sentiments being mentioned in its construction; as I recall the computer was built with malice aforethought, but I can't swear to that.
Of course, then you have "Star Trek", with its numerous tales of computer-controlled societies. None of them are Earth societies, and they tend to be primitve ("The Apple") or stupid ("Spock's Brain"). About this time, Dr. Who's WOTAN was going crazy hypnotizing people (a la "The Invisible Boy")!
I think we've come to the end of our journey at this point. "Star Trek" episodes aside, we have (in 1966) what I think is oldest filmed fictional example of the premise, an episode of "Out of the Unknown", which is based on an E.M. Forester story that may be the oldest literary example. It's called "The Machine Stops", and it is about a machine that provides everything people in its underground society needs, as a way to optimally (from its point of view) manage them.
Sadly, the BBC doesn't seem to allow this show to be viewed online, nor do they sell it.
The irony that I mentioned above? Isaac Asimov was the source for six episodes of "Out of the Unknown", but not any that fit the trope we're looking for!
I hope you've found this interesting and/or useful.