  Bell inequalities are an important tool in device-independent quantum
information processing because their violation can serve as a certificate of
relevant quantum properties. Probably the best known example of a Bell
inequality is due to Clauser, Horne, Shimony and Holt (CHSH), which is defined
in the simplest scenario involving two dichotomic measurements and whose all
key properties are well understood. There have been many attempts to generalise
the CHSH Bell inequality to higher-dimensional quantum systems, however, for
most of them the maximal quantum violation---the key quantity for most
device-independent applications---remains unknown. On the other hand, the
constructions for which the maximal quantum violation can be computed, do not
preserve the natural property of the CHSH inequality, namely, that the maximal
quantum violation is achieved by the maximally entangled state and measurements
corresponding to mutually unbiased bases. In this work we propose a novel
family of Bell inequalities which exhibit precisely these properties, and whose
maximal quantum violation can be computed analytically. In the simplest
scenario it recovers the CHSH Bell inequality. These inequalities involve $d$
measurements settings, each having $d$ outcomes for an arbitrary prime number
$d\geq 3$. We then show that in the three-outcome case our Bell inequality can
be used to self-test the maximally entangled state of two-qutrits and three
mutually unbiased bases at each site. Yet, we demonstrate that in the case of
more outcomes, their maximal violation does not allow for self-testing in the
standard sense, which motivates the definition of a new weak form of
self-testing. The ability to certify high-dimensional MUBs makes these
inequalities attractive from the device-independent cryptography point of view.
