  We present the QCD corrections to the matching conditions of the Delta B =1
magnetic and chromo-magnetic operators in the Standard Model and in two-Higgs
doublet models. We use an off-shell matching procedure which allows us to
perform the computation using Taylor series in the external momenta, instead of
asymptotic expansions. In the Standard Model case, we confirm previous results
derived on-shell and we obtain BR(B -> X_s gamma)=(3.62\pm 0.33) 10^{-4}. In
the case of the usual two-Higgs doublet model, we show that going from the
leading to the next-to-leading order result improves the CLEO bound on the
charged-Higgs mass from 260 GeV to 380 GeV. This limit is very sensitive to the
definition of errors and we carefully discuss the theoretical uncertainties.
Finally, in the case of the two-Higgs doublet model in which both up- and
down-type quarks couple to the same Higgs field, the theoretical prediction for
BR(B -> X_s gamma) can be reduced by at most 20% with respect to the Standard
Model value.
