First-principles simulation of functional materials interfaces