If I understand it correctly, the usual configuration with tandem wings is that the front wing has ailerons - controls the roll. And the rear wing (a bit smaller than the front one) has elevators and rudder to control the pitch and yaw respectively. Am I right? Or are there any mistakes in my understanding?
I think your assumption, that the rear wing is a little bit smaller than the on in front is not necessarily true.
In addition some images depicting the mentioned:
In the case of the Miles M.35 Libellula, featured in the photographs above, the control surface arrangement was as follows: the front wing had flaps outboard and elevators (for pitch control) inboard. The rear wing had flaps inboard and ailerons (for roll control) outboard. Also, as can be clearly seen in the photos, the rear wing had vertical fins with rudders (for yaw control). (From page 18 of first cited source.)
If the front and rear wings have appreciably different span, it is logical to put the ailerons (roll control surfaces) on whichever wing has the larger span, and the M.35 followed this practice.
Many tandem-wing airplanes have a rudder (for yaw control) and vertical fin on the fuselage, not on the tips of the rear wing. The former is arguably more "usual" configuration. Examples: Rutan "Quickie", "Flying Flea". See also the concept design pictured in the first image, and described in the second cited source, of this related answer to the present question.
On the "Quickie", the front surface wing had full-span control surfaces that functioned as elevators. The rear wing had ailerons, mounted inboard.
On the (rather unusual) "Flying Flea", the entire front wing pivoted up and down for pitch control. Roll control was accomplished solely by the rudder, via aerodynamic coupling between yaw (or more properly slip) and roll, thanks to the generous dihedral of the front wing, as well as the high-mounted position of the front wing.
With a tandem-wing aircraft, it makes intuitive sense that you would want the control surfaces to move in such a way as to immediately increase, not decrease, the lift of one of the surfaces to create a nose-up pitch torque, and this only works if the elevators (pitch control surfaces) are on the front wing. However, many of the older "free-flight" model airplanes did have very large tails with lifting airfoils. There have likely been some aircraft, in model form if not in full-scale form, that could arguably be described as "tandem wing" aircraft, with the rear "wing" not too much smaller than the front wing, that had the ailerons in the front and the elevators in the rear. In general, it makes sense to put the ailerons on whichever wing has the greater span, although the inboard position of the ailerons on the Rutan "Quickie" seems to challenge this logic.