Integrated photonic circuits with many input and output modes are essential in applications ranging from conventional optical telecommunication networks, to the elaboration of photonic qubits in the integrated quantum information framework. In particular, the latter field has been object in the recent years of an increasing interest: the compactness and phase stability of integrated waveguide circuits are enabling experiments unconceivable with bulk-optics set-ups. Linear photonic devices for quantum information are based on quantum and classical interference effects: the desired circuit operation can be achieved only with tight fabrication control on both power repartition in splitting elements and phase retardance in the various paths. Here we report on a novel three-dimensional circuit architecture, made possible by the unique capabilities of femtosecond laser waveguide writing, which enables us to realize integrated multimode devices implementing arbitrary linear transformations. Networks of cascaded directional couplers can be built with independent control on the splitting ratios and the phase shifts in each branch. In detail, we show an arbitrarily designed 5×5 integrated interferometer: characterization with one- and two-photon experiments confirms the accuracy of our fabrication technique. We exploit the fabricated circuit to implement a small instance of the boson-sampling experiments with up to three photons, which is one of the most promising approaches to realize phenomena hard to simulate with classical computers. We will further show how, by studying classical and quantum interference in many random multimode circuits, we may gain deeper insight into the bosonic coalescence phenomenon.