Machine like this Pascals Calculator (circa 1652) can be easy used for calculating taxes.
With medieval level of technology making small and precise gear wheels can be quite hard, so probably gears was little bigger that in Pascal's machine - like gear wheels from Salisbury Cathedral Clock circa 1386 year:
There is a text about this clocks.
If me take about 10 clocks mechanisms like this, we can make something close to Pascal's calculator (but with few peasants/slaves used for motivation of device).
Other possible usage of such machines can be processing statistics - see
In general, i think even castle sized Thinking Machine had maximum all the computing power of 1980 years calculator.
UPD1 : there is an other solution to make Thinking Machine with medieval level tech. You just need to gather few dozens of people who can write, read and count using pen and paper and abacuses - and made a human computer from them.
I'll try to find a link, but as far as i remember my historical classes, in Medieval Russia monks in monasteries were ordered record when anybody was born, record marriages, and record deaths of people in surrounding settlements. This was used to gather statistics for Tzar's for strategical planning and deduct where paying taxes were not carefull.
So, the medieval monastery can be easiy used as Monk Powered Thinking Machine.
Just provide them with food, parchment, pencils, and of course, data and algorithm to process it.
UPD2: other uses of Medieval Thinking Machine (both mechanical or monk powered) is cryptography - for example, they can use something like
Vigenère cipher or Caesar cipher. So, they can create/read encrypted messages to/from vassals, even decrypt messages of rivals. To use Ceasar or Vigenère ciphers, you just need pen and paper and you can produce really hard to encrypt messages.