There is a program called MEGAN/tools/compute-comparison that does that.
The metadata format is the same as used for QIIME.
You have a header line that starts with #Samples and is followed by the names of the attributes.
Then subsequent lines start with the name of a dataset and then contains the values of the named attributes. Everything is tab-separated.
Here is an example:
#SampleID Day Subject antibiotic Treatment Health
Alice00-1mio 0 Alice cirprofloxacin no good
Alice01-1mio 1 Alice cirprofloxacin yes good
Alice03-1mio 3 Alice cirprofloxacin yes good