First-principles study of C6B2 and related compounds