The aim of this study is to generate maps of the hard X-ray emission produced by energetic electrons in a solar flare and compare them with observations. The ultimate goal is to test the viability of the combined MHD/test-particle approach for data-driven modelling of active events in the solar corona and their impact on the heliosphere. Based on an MHD model of X-class solar flare observed on the 8th of September 2017, we calculate trajectories of a large number of electrons and protons using the relativistic guiding-centre approach. Using the obtained particle trajectories, we deduce the spatial and energy distributions of energetic electrons and protons, and calculate bremsstrahlung hard X-ray emission using the thin target approximation. Our approach predicts some key characteristics of energetic particles in the considered flare, including the size and location of the acceleration region, energetic particle trajectories and energy spectra. Most importantly, the hard X-ray bremsstrahlung intensity maps predicted by the model are in a good agreement with those observed by RHESSI. Furthermore, the locations of proton and electron precipitation appear to be close to the sources of helioseismic response detected in this flare. Therefore, the adopted approach can be used for observationally-driven modelling of individual solar flares, including manifestations of energetic particles in the corona, as well as inner heliosphere.