Controlling the propagation of light in the form of surface modes on miniaturized platforms is crucial for multiple applications. For dielectric multilayers that sustain Bloch surface waves at their interface to an isotropic dielectric medium, a conventional approach to manipulate them exploits shallow surface topographies fabricated on top of the truncated stack. However, such structures typically exhibit low index contrasts, making it challenging to confine, steer, and guide the Bloch surface waves. Here, we theoretically and experimentally demonstrate a device for a Bloch surface wave platform that resonantly couples light from a cavity to a straight waveguide. The structure is designed using topology optimization in a 2D geometry under the effective index approximation. In particular, the cavity–waveguide coupling efficiency of the radiation emitted by an individual source in the cavity center is optimized. The cavity is experimentally found to exhibit a narrow resonant peak that can be tuned by scaling the structure. The waveguide is shown to guide only light that resonates in the cavity. Fully three-dimensional simulations of the entire device validate the experimental observations.