I figured it out I had to create Dictionaries before I tried to work with these maps.
This post helped me a lot.
So what I do now, is this:
import ROOT
ROOT.gROOT.ProcessLine(".L legacy.h+O")
ROOT.gInterpreter.GenerateDictionary("map<string,MyClass>","map;string;legacy.h")
ROOT.gSystem.Load("legacy_h.so")
Again some AutoDict files are generated of course, they look equal to the ones that were created, when I tried to create a map with
m = ROOT.std.map(str, ROOT.Legacy.MyClass)()
but this time it works. I guess the order matters a lot.
I still feel not quite sure what I am doing here and wonder if there is any good book/manual about this matter. So in case you know anything please let me know.
Thank you for your time.