Electronic structure and magnetism of surfaces and interfaces: Selected examples