You have to specify the content type and content encoding on your event, otherwise, the SDK will do Base64 encoding by default. Your question doesn't specify what language you're using, but here's a C# sample:
string dataBuffer = $"{{\"foo\": 42,\"bar\":{42},}}";
using var eventMessage = new Message(Encoding.UTF8.GetBytes(dataBuffer))
{
ContentType = "application/json",
ContentEncoding = Encoding.UTF8.ToString(),
};
await _deviceClient.SendEventAsync(eventMessage);
There is a bit more context in this blog post.