Many lords attracted immigrants to cut down clearings and plough new plots of land. In the northeastern parts of Europe, significant advances were also made in lands that had swamps and other water sources. All of this increased production, as did improvements in administration techniques and field rotation, particularly in the Early Middle Ages. The growth of commerce (both local and international) could also prove an important element of the economy, particularly in the traditional capitals of trade, which varied greatly over time.
Also, in the 15th century, when large amounts of grain were imported from Eastern Europe, people in the west of the continent started to specialize in more valuable products. The part of industry is also a very important factor, especially in places like the Low Countries, England, southern France, Barcelona and the Italian city-states.
So, to sum up, you're mostly correct in your assumption that the country with the highest production could be considered "the richest", but that's not really much of a surprise, is it? More or less the same oculd be said about modern states.
As /u/Ikonovich has already pointed out, the medieval economy was far from static.
More important question: was there GDP growth?
Subsistence farming doesn't really tend to increase wealth over time.